Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improvement: queue or cancel previous connect request #6691

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kasiaMarek
Copy link
Contributor

No description provided.

@kasiaMarek kasiaMarek force-pushed the cancel-build-server-connection branch 3 times, most recently from 333669a to b1564af Compare August 20, 2024 12:36
@kasiaMarek kasiaMarek force-pushed the cancel-build-server-connection branch from b1564af to 3f2a29b Compare August 20, 2024 14:51
@@ -211,18 +212,12 @@ class SbtBloopLspSuite
_ = assertNoDiff(
client.beginProgressMessages,
List(
progressMessage,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't deduplicate like this anymore. Instead requests will be queued and the first one will get cancelled. So sbt bloopInstall will be executed twice, and the first request will be cancelled after that, so import and indexing are executed only once.

@kasiaMarek kasiaMarek marked this pull request as ready for review August 21, 2024 08:26
val iter = queue.iterator()
while (iter.hasNext()) {
val curr = iter.next()
request.cancelCompare(iter.next().request) match {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain the logic a bit better here? Could we use some case objects instead of just numbers?


class Interruptable[+T] private (
futureIn: Future[T],
cancelPromise: Promise[Unit],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we able to forward the cancel request to an underlying process if for example bloopInstall is running?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants